<template>
	<view>
		<view class="records">
			<view class="amount"><text v-show="detail.balanceChange > 0">+</text>{{detail.balanceChange}}
			</view>
			<view class="record">
				<view class="record-item">
					<view class="record-item-l">
						变动后余额
					</view>
					<view class="record-item-r">
						{{detail.balanceAfter}}
					</view>
				</view>
				<view class="record-item">
					<view class="record-item-l">
						时间
					</view>
					<view class="record-item-r">
						{{detail.changeTime}}
					</view>
				</view>
				<view class="record-item" v-show="detail.note">
					<view class="record-item-l">
						备注
					</view>
					<view class="record-item-r">
						{{detail.note}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				detail: '',
			}
		},
		onLoad(option) {
			this.id = option.id;
			this.getDetail();
		},
		methods: {

			getDetail() {
				var that = this;
				uni.$uv.http.get('/memberBalanceChangeLog/getDetail', {
					params: {
						id: that.id
					}
				}).then(res => {
					that.detail = res.data;
					uni.setNavigationBarTitle({
						title: that.detail.changeTypeName
					});
				});
			},
		}
	}
</script>

<style>
	.records {
		padding-bottom: 20rpx;
	}

	.amount {
		padding-left: 32rpx;
		padding-right: 32rpx;
		font-size: 40rpx;
		color: #007aff;
		font-weight: bold;
	}

	.record {
		padding-left: 32rpx;
		padding-right: 32rpx;
		padding-top: 20rpx;
		padding-bottom: 20rpx;
	}

	.record-item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 28rpx;
		line-height: 4;
	}

	.record-item-l {
		color: #909399;
	}

	.record-item-r {}

	.record-item-r-red {
		color: #e64340;
	}
</style>